<div :class="{ 'grid': true, 'show-paging-bar': isEnablePagingBar, 'hidden-paging-bar': !isEnablePagingBar }">
    <i-form>
        <el-table v-if="isDisplay === true"
            :default-sort="{ prop: minorSortPSDEF, order: Object.is(minorSortDir, 'ASC') ? 'ascending' : Object.is(minorSortDir, 'DESC') ? 'descending' : '' }"  
            @sort-change="onSortChange($event)"  
            :border="isDragendCol"
            :highlight-current-row ="isSingleSelect"
            :row-class-name="getRowClassName.bind(_self)"
            :cell-class-name="getCellClassName.bind(_self)"
            size="mini"
            stripe
            :height="tableHeight"
            @row-click="rowClick($event)"  
            @select-all="selectAll($event)"  
            @select="select.apply(_self, arguments)"  
            @row-class-name="onRowClassName($event)"  
            @row-dblclick="rowDBLClick($event)"  
            ref="multipleTable" :data="items" :show-header="!isHideHeader"
        >
            <template slot="empty">
                {{$t('entities.case.mainlinktest_grid.nodata')}} 
                <span class="quick-toolbar">
                </span>
            </template>
            <template v-if="!isSingleSelect">
                <el-table-column align="center" type="selection" :width="checkboxColWidth"></el-table-column>
            </template>
            <template v-if="getColumnState('id')">
                <el-table-column show-overflow-tooltip :prop="'id'" :label="$t('entities.case.mainlinktest_grid.columns.id')" :width="80"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.case.mainlinktest_grid.columns.id')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template v-if="actualIsOpenEdit">
                            <app-form-item :error="gridItemsModel[$index][column.property].error">
                                
            <app-span name='id' :value="row[column.property]" :data="row" :context="context" :viewparams="viewparams" :localContext ='{ }'  :localParam ='{ }'    style=""
            ></app-span>
            
                            </app-form-item>
                        </template>
                        <template v-if="!actualIsOpenEdit">
                                    <app-span
                                        name="id"
                                        editorType="SPAN"
            :value="row.id" dataType="ACID" 
            precision="0" 
                                    ></app-span>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('version')">
                <el-table-column show-overflow-tooltip :prop="'version'" :label="$t('entities.case.mainlinktest_grid.columns.version')" :width="80"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.case.mainlinktest_grid.columns.version')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template v-if="actualIsOpenEdit">
                            <app-form-item :error="gridItemsModel[$index][column.property].error">
                                
            <dropdown-list 
                
                v-model="row[column.property]" 
                :disabled="getColumnDisabled(row,column.property)" 
                :data="row" 
                :context="context"
                :viewparams="viewparams" 
                :localContext='{ CASE:"%case%" }' 
                :localParam='{ case:"%case%" }' 
                tag="CurCaseVersion" 
                codelistType="DYNAMIC"
                placeholder="请选择..." 
                style="" 
                @change="($event)=>{gridEditItemChange(row, column.property, $event, $index)}"
            ></dropdown-list>
            
                            </app-form-item>
                        </template>
                        <template v-if="!actualIsOpenEdit">
            <codelist :value="row.version" tag="CurCaseVersion" codelistType="DYNAMIC" ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('pri')">
                <el-table-column show-overflow-tooltip :prop="'pri'" :label="$t('entities.case.mainlinktest_grid.columns.pri')" :width="80"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.case.mainlinktest_grid.columns.pri')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.pri" tag="Testcase__pri" codelistType="STATIC" ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('title')">
                <el-table-column show-overflow-tooltip :prop="'title'" :label="$t('entities.case.mainlinktest_grid.columns.title')" :min-width="500"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.case.mainlinktest_grid.columns.title')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
                                  <span><app-column-link deKeyField='case' :context="JSON.parse(JSON.stringify(context))" :localParam="{product: '%product%'}" :viewparams="JSON.parse(JSON.stringify(viewparams))" :data="row" :linkview="{viewname: 'case-main-dashboard-view', height: 850,width: 1400,title: $t('entities.build.views.maintabexpview.title'),placement: 'DRAWER_TOP', isRedirectView: false}" valueitem="srfkey">
            <span :style="{'color':row.color}">{{row.title}}</span>
            </app-column-link>
            </span>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('type')">
                <el-table-column show-overflow-tooltip :prop="'type'" :label="$t('entities.case.mainlinktest_grid.columns.type')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.case.mainlinktest_grid.columns.type')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.type" tag="Testcase__type" codelistType="STATIC" ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('openedby')">
                <el-table-column show-overflow-tooltip :prop="'openedby'" :label="$t('entities.case.mainlinktest_grid.columns.openedby')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.case.mainlinktest_grid.columns.openedby')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.openedby" tag="UserRealName_Gird" codelistType="DYNAMIC" renderMode="STR" valueSeparator="," textSeparator="," ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('lastrunner')">
                <el-table-column show-overflow-tooltip :prop="'lastrunner'" :label="$t('entities.case.mainlinktest_grid.columns.lastrunner')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.case.mainlinktest_grid.columns.lastrunner')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.lastrunner" tag="UserRealName_Gird" codelistType="DYNAMIC" renderMode="STR" valueSeparator="," textSeparator="," ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('lastrundate')">
                <el-table-column show-overflow-tooltip :prop="'lastrundate'" :label="$t('entities.case.mainlinktest_grid.columns.lastrundate')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.case.mainlinktest_grid.columns.lastrundate')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data format="YYYY-MM-DD HH:mm:ss" :data="row.lastrundate"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('lastrunresult')">
                <el-table-column show-overflow-tooltip :prop="'lastrunresult'" :label="$t('entities.case.mainlinktest_grid.columns.lastrunresult')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.case.mainlinktest_grid.columns.lastrunresult')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.lastrunresult" tag="Testcase__result" codelistType="STATIC" ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('status1')">
                <el-table-column show-overflow-tooltip :prop="'status1'" :label="$t('entities.case.mainlinktest_grid.columns.status1')" :width="80"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.case.mainlinktest_grid.columns.status1')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.status1" tag="TestCaseStatusGrid" codelistType="STATIC" ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="adaptiveState">
                <el-table-column></el-table-column>
            </template>
        </el-table>
        <row class="grid-pagination" v-show="items.length > 0">
            <page class="pull-right" @on-change="pageOnChange($event)" 
                @on-page-size-change="onPageSizeChange($event)"
                :total="totalRecord"
                show-sizer :current="curPage" :page-size="limit"
                :page-size-opts="[10, 20, 30, 40, 50, 60, 70, 80, 90, 100]" show-elevator show-total>
                <span>
                    <span class="page-column">
                        <poptip transfer-class-name="grid-column" transfer placement="top-start">
                            <i-button icon="md-menu">{{$t('app.gridpage.choicecolumns')}}</i-button>
                            <div slot="content">
                                <template v-for="col in allColumns">
                                    <div :key="col.name"><el-checkbox v-model="col.show" @change="onColChange()">{{$t(col.langtag)}}</el-checkbox></div>
                                </template>
                            </div>
                        </poptip>
                    </span>
                    <span class="page-button"><i-button icon="md-refresh" :title="$t('app.gridpage.refresh')" @click="pageRefresh()"></i-button></span>&nbsp;
                    <span>
                        {{$t('app.gridpage.show')}}&nbsp;
                        <span>
                            <template v-if="items.length === 1">
                            1
                            </template>
                            <template v-else>
                                <span>{{(curPage - 1) * limit + 1}}&nbsp;-&nbsp;{{totalRecord > curPage * limit ? curPage * limit : totalRecord}}</span>
                            </template>
                        </span>&nbsp;
                        {{$t('app.gridpage.records')}}，{{$t('app.gridpage.totle')}}&nbsp;{{totalRecord}}&nbsp;{{$t('app.gridpage.records')}}
                    </span>
                </span>
            </page>
        </row>
    </i-form>
</div>